import cv2
import numpy as np
img=cv2.imread(r"D:\Project\Project37\Project37\tupian\chess.jpg")
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# corners=cv2.goodFeaturesToTrack(gray,1000,0.01,10)
# corners=np.int32(corners)
# for i in corners:
#     x,y=i.ravel()
#     cv2.circle(img,(x,y),3,(255,0,0),-1)
# cv2.imshow('img',img)
# cv2.waitKey(0)
sift=cv2.xfeatures2d.SIFT_create()
kp=sift.detect(gray,None)
cv2.drawKeypoints(gray,kp,img)
cv2.imshow('img',img)
cv2.waitKey(0)